I was required to build an interactive application showing a 3D virtual world consisting of various static and procedurally animated rigid objects. The application is a hardware - accelerated DirectX 11 graphics application developed using Hieroglyph 3 and Visual C++.
The 3D world is constructed using a variety of graphical primitives, procedurally generated mesh or premade 3D models, which are assembled into a 3D scene using the various transform operations. All objects are represented via the Hieroglyph Scene Manager and its associated Actor system. The application demonstrates different combinations of various graphical transforms such as translation, rotation and scaling operations to create unique animations and movements. I have implemented varius animation techniques such us key - framing, in - betweening, curved animation paths and scripted animations.
I have started an implementation of the Artefact by choosing a particular scene that I would like to simulate/present. I chose that my main object on the scene will be Space Ship which will constantly be starting from the ground into space and, after it reaches maximum point on the Y axis it will come back.
To animate a Space Ship Object I implemented linear interpolation. I set a maximum point on the Y axis using Vector3f. I used this vector to defined maximum height for the movement. When Space Ship reaches this point, it will start moving in the opposite direction. I created 2 variables for the speed increasing/decreasing. These are float speed and float acceleration where speed is being increased when Space Ship Moving Up by adding acceleration value each frame. Then if Space Ship is moving in the opposite direction (returning to the starting point) speed is being decreased by subtract acceleration each frame until Space Ship reaches starting point.
SpaceShip Movement Lights
The purpose of these lights is simple yet very important. I used these lights in order to control SpaceShip movement. We cannot control the object directly but we can change the current light in the menu panel (by pressing left or right arrow key). Now it allows us to create some different scenarios:
Green LightisOn scenario: If the green light is on and Space Ship is on the ground, the it can start again movement in positive direction along the Y axis. Even if Space Ship is in the air (between minimum point and maximum point of movement) it can land and try to start again.
We can see green light, engines are on and particles are visible.
YellowLightisOn scenario: If the yellow light is on and Space Ship is on the ground, then it cannot start again movement in positive direction along the Y axis. It can however turn on its engines in order to become ready to start (We will be able to see smoke particles from the bottom of the Space Ship Object). However if Space Ship is in the air (between minimum point and maximum point of movement) it will land and we will still be able to see smoke but it cannot start again until we will change the light to green.
Yellow Light is on. That means smoke is visible but a rocket cannot start.
RedLightisOn scenario: If the red light is on and Space Ship is on the ground, then it cannot start again movement in positive direction along the Y axis. We cannot see any smoke particles because we try to simulate turned off engines. However if Space Ship is in the air (between minimum point and maximum point of movement) it will land and we will still be able to see smoke(but only during the landing process) but it cannot start.
Red Light is on. That means smoke is not visible(except those particles that already have been created) and rocket cannot start.
As a next movable object I decided to create a drone which can be turn on or off using a button in a menu button. In order to do that I imported drone 3D model in OBJ format with UV map. I used the textures for this model as well. As the movement of the drone has to be trigged by clicking a button in the menu panel I have to create few different states of the drone. I created some Booleans which are the flags that help in transition between different states. Heading 2 Example
H2 Text Here.
The bool HQGatesOpen is an exception here. It is used to change a Drone's states but it is an integral part of the HeadQuarters building. The basic Idea is: when we will click a button in the menu we will change Enable Drone from false to true (then if we will do that again it will be changed to false) the gates will start the process of opening (which is a translation of the gates objects in the opposite direction with fixed speed). When the gates are open the flag HQGatesOpen will be TRUE. Then if it is true the drone will start to move along the Y axis. If it will at desired height and HQGatesOpen will be false, the drone will start patrolling. The patrolling is a movement which uses circle trajectory.
Then if we will disable a drone during a patrolling movement, the flag DroneisPatrolling will become false. Therefore it will stop patrolling and will start the process of returning to the HQ. I used a simple translation from the current location to the position where HQ is located.
I have made a simple model in Blender for the mine object and I used ico sphere model that I imported before for a resource model. I also imported a drill model.
Animation of Mine Building - Simple translation.
Mine Object with Drill in place
For the Resource animation I made use of drill's position and current direction as well as additional static integer MineCycles.
MineCycles changing
To complete all the animation for the mine I decided to create a very simple robot in Blender. I imported it in OBJ format to the models folder. Then I assigned the mesh to the actor.
Then I set its initial position, rotation and scale to fit the main radar building (My goal was to place the robot inside this building). The purpose of adding a robot was to simulating taking the resource from the mine into the radar building for a further research. The robot is fully dependent on resource position. If the resource is on its desired position, the robot will start its animation which is a linear movement from the current position to the resource's position. Then if robot reaches resource's position, the resource will be back on its starting position and robot will start another linear movement from the current position to the Radar's position.
Robot Animation implenentation.
The robot is going to pick up a resource.
For the 2D Overlay I created a simple menu panel with some options available to use. First I loaded all the 2D panels and textures. I also loaded my menu buttons here. (I created text for the each button and I added all of the to the dynamic array).
Loading the textures and setting up the buttons.
Loading menu sprites items and positioning on the screen using matrices transformations.
Setting up output of FPS position on the screen and adding the text to the dedicated dynamic array. Setting up the Controls panel.